<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .list{
      width: 300px;
      min-height: 300px;
      border: 2px solid #000;
    }
  </style>
</head>
<body>
  <ul class="list"></ul>

  <script>
    const ul = document.querySelector('.list')
    const items = ['apple', 'banana', 'cherry' , 'cheese', 'citrus', 'Dates']

    // 文档碎片
    // let frg = document.createDocumentFragment()

    // 克隆
    const cloneUl = ul.cloneNode(true)
    for (let i = 0; i < items.length; i++) {
      const li = document.createElement('li')
      li.textContent = items[i]
      cloneUl.appendChild(li)
    }
    ul.parentNode.replaceChild(cloneUl, ul)

  </script>
</body>
</html>